#!/usr/bin/env python
#coding=utf-8
#File: form.py

import cgi
import cgitb; cgitb.enable()

print "Content-type: text/html"
print

def main():
    form = cgi.FieldStorage()
    if not (form.has_key("name") and form.has_key("addr")):
        print "<h1>Error</h1>"
        print "Please fill in the name and addr fields."
        return

    print "<p>name:", form["name"].value
    print "<p>addr:", form["addr"].value
    
if __name__=='__main__': 
    main()